/**
 * Created by miaoyu on 2017/7/19.
 */
function addConcern(btn) {
    $.ajax({
            url: '/ConcernServlet',
            type: "POST",
            data: {
                concernUser: $("#userInfo_name").val(),
                action:"add"
            }
            ,
            success: function (data) {
                switch (data['code']) {
                    case 0:
                        //alert("成功关注");
                        window.location.reload();
                        break;
                    case 1:
                        alert("失败！");
                        break;
                }
            }
            ,
            error: function (err) {
                console.log(err);
            }
        }
    );

}

function deleteConcern() {
    $.ajax({
            url: '/ConcernServlet',
            type: "POST",
            data: {
                concernUser: $("#userInfo_name").val(),
                action:"delete"
            }
            ,
            success: function (data) {
                switch (data['code']) {
                    case 0:
                        //alert("成功取关");
                        window.location.reload();
                        break;
                    case 1:
                        alert("失败！");
                        break;
                }
            }
            ,
            error: function (err) {
                console.log(err);
            }
        }
    );
}